/*
 *
 *
 *
 *
 * Scaloid: Simpler Android
 *
 * http://scaloid.org
 *
 *
 *
 *
 *
 *
 * Copyright 2013 Sung-Ho Lee and Scaloid contributors
 *
 * Sung-Ho Lee and Scaloid contributors licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

/*
 * This file is automatically generated. Any changes on this file will be OVERWRITTEN!
 * To learn how to contribute, please refer to:
 * https://github.com/pocorall/scaloid/wiki/Inside-Scaloid
 */

package org.scaloid.support.v4

import org.scaloid.common._

/**
 * Automatically generated enriching class of `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html android.support.v4.view.ViewPager]]`.
 */
class RichViewPager[This <: android.support.v4.view.ViewPager](val basis: This) extends TraitViewPager[This]

/**
 * Automatically generated helper trait of `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html android.support.v4.view.ViewPager]]`. This contains several property accessors.
 */
trait TraitViewPager[This <: android.support.v4.view.ViewPager] extends TraitViewGroup[This] {

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#getAdapter() getAdapter()]]`
   */
  @inline def adapter = basis.getAdapter

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setAdapter(android.support.v4.view.PagerAdapter) setAdapter(android.support.v4.view.PagerAdapter)]]`
   */
  @inline def adapter(p: android.support.v4.view.PagerAdapter) = adapter_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setAdapter(android.support.v4.view.PagerAdapter) setAdapter(android.support.v4.view.PagerAdapter)]]`
   */
  @inline def adapter_=(p: android.support.v4.view.PagerAdapter) = { basis.setAdapter(p); basis }

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#getCurrentItem() getCurrentItem()]]`
   */
  @inline def currentItem = basis.getCurrentItem

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem(int) setCurrentItem(int)]]`
   */
  @inline def currentItem(p: Int) = currentItem_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem(int) setCurrentItem(int)]]`
   */
  @inline def currentItem_=(p: Int) = { basis.setCurrentItem(p); basis }

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#getOffscreenPageLimit() getOffscreenPageLimit()]]`
   */
  @inline def offscreenPageLimit = basis.getOffscreenPageLimit

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setOffscreenPageLimit(int) setOffscreenPageLimit(int)]]`
   */
  @inline def offscreenPageLimit(p: Int) = offscreenPageLimit_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setOffscreenPageLimit(int) setOffscreenPageLimit(int)]]`
   */
  @inline def offscreenPageLimit_=(p: Int) = { basis.setOffscreenPageLimit(p); basis }

  @inline def onPageChangeListener(implicit no: NoGetterForThisProperty): Nothing = throw new Error("Android does not support the getter for 'onPageChangeListener'")

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener) setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener)]]`
   */
  @inline def onPageChangeListener(p: android.support.v4.view.ViewPager.OnPageChangeListener) = onPageChangeListener_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener) setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener)]]`
   */
  @inline def onPageChangeListener_=(p: android.support.v4.view.ViewPager.OnPageChangeListener) = { basis.setOnPageChangeListener(p); basis }

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#getPageMargin() getPageMargin()]]`
   */
  @inline def pageMargin = basis.getPageMargin

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setPageMargin(int) setPageMargin(int)]]`
   */
  @inline def pageMargin(p: Int) = pageMargin_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setPageMargin(int) setPageMargin(int)]]`
   */
  @inline def pageMargin_=(p: Int) = { basis.setPageMargin(p); basis }

  @inline def pageMarginDrawable(implicit no: NoGetterForThisProperty): Nothing = throw new Error("Android does not support the getter for 'pageMarginDrawable'")

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setPageMarginDrawable(int) setPageMarginDrawable(int)]]`
   */
  @inline def pageMarginDrawable(p: Int) = pageMarginDrawable_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setPageMarginDrawable(int) setPageMarginDrawable(int)]]`
   */
  @inline def pageMarginDrawable_=(p: Int) = { basis.setPageMarginDrawable(p); basis }

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setPageMarginDrawable(android.graphics.drawable.Drawable) setPageMarginDrawable(android.graphics.drawable.Drawable)]]`
   */
  @inline def pageMarginDrawable(p: android.graphics.drawable.Drawable) = pageMarginDrawable_=(p)

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setPageMarginDrawable(android.graphics.drawable.Drawable) setPageMarginDrawable(android.graphics.drawable.Drawable)]]`
   */
  @inline def pageMarginDrawable_=(p: android.graphics.drawable.Drawable) = { basis.setPageMarginDrawable(p); basis }

  @inline def onPageScrollStateChanged[U](f: Int => U): This = {
    basis.setOnPageChangeListener(new android.support.v4.view.ViewPager.OnPageChangeListener {
      def onPageScrollStateChanged(p: Int): Unit = { f(p) }
      def onPageScrolled(p1: Int, p2: Float, p3: Int): Unit = {}
      def onPageSelected(p: Int): Unit = {}
    })
    basis
  }

  @inline def onPageScrollStateChanged[U](f: => U): This = {
    basis.setOnPageChangeListener(new android.support.v4.view.ViewPager.OnPageChangeListener {
      def onPageScrollStateChanged(p: Int): Unit = { f }
      def onPageScrolled(p1: Int, p2: Float, p3: Int): Unit = {}
      def onPageSelected(p: Int): Unit = {}
    })
    basis
  }

  @inline def onPageScrolled[U](f: (Int, Float, Int) => U): This = {
    basis.setOnPageChangeListener(new android.support.v4.view.ViewPager.OnPageChangeListener {
      def onPageScrollStateChanged(p: Int): Unit = {}
      def onPageScrolled(p1: Int, p2: Float, p3: Int): Unit = { f(p1, p2, p3) }
      def onPageSelected(p: Int): Unit = {}
    })
    basis
  }

  @inline def onPageScrolled[U](f: => U): This = {
    basis.setOnPageChangeListener(new android.support.v4.view.ViewPager.OnPageChangeListener {
      def onPageScrollStateChanged(p: Int): Unit = {}
      def onPageScrolled(p1: Int, p2: Float, p3: Int): Unit = { f }
      def onPageSelected(p: Int): Unit = {}
    })
    basis
  }

  @inline def onPageSelected[U](f: Int => U): This = {
    basis.setOnPageChangeListener(new android.support.v4.view.ViewPager.OnPageChangeListener {
      def onPageScrollStateChanged(p: Int): Unit = {}
      def onPageScrolled(p1: Int, p2: Float, p3: Int): Unit = {}
      def onPageSelected(p: Int): Unit = { f(p) }
    })
    basis
  }

  @inline def onPageSelected[U](f: => U): This = {
    basis.setOnPageChangeListener(new android.support.v4.view.ViewPager.OnPageChangeListener {
      def onPageScrollStateChanged(p: Int): Unit = {}
      def onPageScrolled(p1: Int, p2: Float, p3: Int): Unit = {}
      def onPageSelected(p: Int): Unit = { f }
    })
    basis
  }

}

/**
 * Automatically generated concrete helper class of `[[https://developer.android.com/reference/android/support/v4/view/ViewPager.html android.support.v4.view.ViewPager]]`.
 */
class SViewPager()(implicit context: android.content.Context, parentVGroup: TraitViewGroup[_] = null)
  extends android.support.v4.view.ViewPager(context) with TraitViewPager[SViewPager] {

  def basis = this
  override val parentViewGroup = parentVGroup

}

object SViewPager {
  def apply[LP <: ViewGroupLayoutParams[_, SViewPager]]()(implicit context: android.content.Context, defaultLayoutParam: SViewPager => LP): SViewPager = {
    val v = new SViewPager
    v.<<.parent.+=(v)
    v
  }

}

/**
 * Automatically generated enriching class of `[[https://developer.android.com/reference/android/support/v4/view/PagerAdapter.html android.support.v4.view.PagerAdapter]]`.
 */
class RichPagerAdapter[This <: android.support.v4.view.PagerAdapter](val basis: This) extends TraitPagerAdapter[This]

/**
 * Automatically generated helper trait of `[[https://developer.android.com/reference/android/support/v4/view/PagerAdapter.html android.support.v4.view.PagerAdapter]]`. This contains several property accessors.
 */
trait TraitPagerAdapter[This <: android.support.v4.view.PagerAdapter] {

  def basis: This

  /**
   * Shortcut for `[[https://developer.android.com/reference/android/support/v4/view/PagerAdapter.html#getCount() getCount()]]`
   */
  @inline def count = basis.getCount

}

trait ViewImplicits {
  import scala.language.implicitConversions
  @inline implicit def viewPager2RichViewPager[V <: android.support.v4.view.ViewPager](viewPager: V) = new RichViewPager[V](viewPager)
  @inline implicit def pagerAdapter2RichPagerAdapter[V <: android.support.v4.view.PagerAdapter](pagerAdapter: V) = new RichPagerAdapter[V](pagerAdapter)
}
object ViewImplicits extends ViewImplicits
